import {myFetch} from '@/assets/js/utils.js'
const env = process.env.NODE_ENV

export default{
	// 获取地址列表
	async getAddressList(){
		const data = await myFetch({
				name: 'shopping.sys.address.list'
			})
		return data
	},
	// 新增地址
	async addAddress({receive_name, receive_mobile,
		receive_province, receive_city,
		receive_area, receive_address, selected}){
		const data = await myFetch({
			name: 'shopping.sys.address.add',
            receive_name,
            receive_mobile,
            receive_province,
            receive_city,
            receive_area,
            receive_address,
            receive_myname: '',
            receive_IDnumber: '',
            receive_myphone: '',
            selected
			})
		return data
	},
	// 编辑地址
	async editAddress({address_id, receive_name, receive_mobile,
		receive_province, receive_city,
		receive_area, receive_address, selected}){
		const data = await myFetch({
			name: 'shopping.sys.address.update',
			address_id,
            receive_name,
            receive_mobile,
            receive_province,
            receive_city,
            receive_area,
            receive_address,
            receive_myname: '',
            receive_IDnumber: '',
            receive_myphone: '',
            selected
			})
		return data
	},
	// 删除地址
	async removeAddress(address_id) {
		const data = await myFetch({
			name: 'shopping.sys.address.del',
			address_id,
			user_id: 0
		})
		return data
	}
}